<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=US-ASCII">
<title>Implementation Details</title>
<link rel="stylesheet" href="../../../../../../doc/src/boostbook.css" type="text/css">
<meta name="generator" content="DocBook XSL Stylesheets V1.75.2">
<link rel="home" href="../../index.html" title="Chapter&#160;1.&#160;Phoenix 3.2.0">
<link rel="up" href="../lazy_list.html" title="Lazy List">
<link rel="prev" href="exceptions.html" title="Exceptions">
<link rel="next" href="testing.html" title="Testing">
</head>
<body bgcolor="white" text="black" link="#0000FF" vlink="#840084" alink="#0000FF">
<table cellpadding="2" width="100%"><tr>
<td valign="top"><img alt="Boost C++ Libraries" width="277" height="86" src="../../../../../../boost.png"></td>
<td align="center"><a href="../../../../../../index.html">Home</a></td>
<td align="center"><a href="../../../../../../libs/libraries.htm">Libraries</a></td>
<td align="center"><a href="http://www.boost.org/users/people.html">People</a></td>
<td align="center"><a href="http://www.boost.org/users/faq.html">FAQ</a></td>
<td align="center"><a href="../../../../../../more/index.htm">More</a></td>
</tr></table>
<hr>
<div class="spirit-nav">
<a accesskey="p" href="exceptions.html"><img src="../../../../../../doc/src/images/prev.png" alt="Prev"></a><a accesskey="u" href="../lazy_list.html"><img src="../../../../../../doc/src/images/up.png" alt="Up"></a><a accesskey="h" href="../../index.html"><img src="../../../../../../doc/src/images/home.png" alt="Home"></a><a accesskey="n" href="testing.html"><img src="../../../../../../doc/src/images/next.png" alt="Next"></a>
</div>
<div class="section">
<div class="titlepage"><div><div><h3 class="title">
<a name="phoenix.lazy_list.implementation_details"></a><a class="link" href="implementation_details.html" title="Implementation Details">Implementation
      Details</a>
</h3></div></div></div>
<h3>
<a name="phoenix.lazy_list.implementation_details.h0"></a>
        <span><a name="phoenix.lazy_list.implementation_details.introduction"></a></span><a class="link" href="implementation_details.html#phoenix.lazy_list.implementation_details.introduction">Introduction</a>
      </h3>
<p>
        The implementation has depended on close study of the existing code of <a href="http://cgi.di.uoa.gr/~smaragd/fc++/" target="_top">FC++</a>. The <a href="http://people.cs.umass.edu/~yannis/fc++/New/new_list_implementation.html" target="_top">FC++
        List Implementation</a> is a carefully crafted code which allows for
        efficient processing of a number of different cases. In particular it makes
        use of the <a href="http://people.cs.umass.edu/~yannis/fc++/New/reusers.html" target="_top">FC++
        Reuser Implementation</a> for processing of repetitive evaluations.
      </p>
<p>
        <a href="http://cgi.di.uoa.gr/~smaragd/fc++/" target="_top">FC++</a> uses a combination
        of polymorphic and single type functions which can be passed as arguments
        to other functions.
      </p>
<p>
        The implementation of list&lt;T&gt; has needed new implementations of the
        strategy using the facilities of Boost Phoenix and also Boost Function. It
        turns out that a combination of both can be used to meet the needs of list&lt;T&gt;.
      </p>
<p>
        The fact that the functions are defined by boost::phoenix::function means
        that they work with phoenix arguments such as 'arg1'. This is the fact which
        ensures the flexibility needed for the user to build new functions as needed.
      </p>
<h3>
<a name="phoenix.lazy_list.implementation_details.h1"></a>
        <span><a name="phoenix.lazy_list.implementation_details.fc___legacy"></a></span><a class="link" href="implementation_details.html#phoenix.lazy_list.implementation_details.fc___legacy">FC++ legacy</a>
      </h3>
<p>
        The <a href="http://people.cs.umass.edu/~yannis/fc++/New/new_list_implementation.html" target="_top">FC++
        List Implementation</a> and the <a href="http://people.cs.umass.edu/~yannis/fc++/New/reusers.html" target="_top">FC++
        Reuser Implementation</a> have been followed very closely in building
        this code. The version used as the starting point was the <a href="http://cgi.di.uoa.gr/~smaragd/fc++/boostpaper/" target="_top">Boost
        FC++</a> version.
      </p>
<h3>
<a name="phoenix.lazy_list.implementation_details.h2"></a>
        <span><a name="phoenix.lazy_list.implementation_details.polymorphic_function_types"></a></span><a class="link" href="implementation_details.html#phoenix.lazy_list.implementation_details.polymorphic_function_types">Polymorphic
        Function Types</a>
      </h3>
<p>
        Functions are implemented as a struct within namespace impl. For an example
        funcion 'x' the type is defined like this:
      </p>
<pre class="programlisting"><span class="keyword">typedef</span> <span class="identifier">boost</span><span class="special">::</span><span class="identifier">phoenix</span><span class="special">::</span><span class="identifier">function</span><span class="special">&lt;</span><span class="identifier">impl</span><span class="special">::</span><span class="identifier">X</span><span class="special">&gt;</span> <span class="identifier">X</span><span class="special">;</span>
<span class="identifier">X</span> <span class="identifier">x</span>
</pre>
<p>
        This alternative will work to provide a function 'x' but it is not then possible
        to pass it as an argument.
      </p>
<pre class="programlisting"><span class="identifier">BOOST_PHOENIX_ADAPT_CALLABLE</span><span class="special">(</span><span class="identifier">x</span><span class="special">,</span> <span class="identifier">impl</span><span class="special">::</span><span class="identifier">X</span><span class="special">,</span> <span class="number">1</span><span class="special">)</span>
</pre>
<h4>
<a name="phoenix.lazy_list.implementation_details.h3"></a>
        <span><a name="phoenix.lazy_list.implementation_details.implementation_example"></a></span><a class="link" href="implementation_details.html#phoenix.lazy_list.implementation_details.implementation_example">Implementation
        Example</a>
      </h4>
<p>
        This example implements id() which simply returns its argument:
      </p>
<pre class="programlisting"><span class="keyword">namespace</span> <span class="identifier">impl</span> <span class="special">{</span>

  <span class="keyword">struct</span> <span class="identifier">Id</span>
  <span class="special">{</span>
    <span class="keyword">template</span> <span class="special">&lt;</span><span class="keyword">typename</span> <span class="identifier">Sig</span><span class="special">&gt;</span>
    <span class="keyword">struct</span> <span class="identifier">result</span><span class="special">;</span>

    <span class="keyword">template</span> <span class="special">&lt;</span><span class="keyword">typename</span> <span class="identifier">This</span><span class="special">,</span> <span class="keyword">typename</span> <span class="identifier">A0</span><span class="special">&gt;</span>
    <span class="keyword">struct</span> <span class="identifier">result</span><span class="special">&lt;</span><span class="identifier">This</span><span class="special">(</span><span class="identifier">A0</span><span class="special">)&gt;</span>
       <span class="special">:</span> <span class="identifier">boost</span><span class="special">::</span><span class="identifier">remove_reference</span><span class="special">&lt;</span><span class="identifier">A0</span><span class="special">&gt;</span>
    <span class="special">{};</span>

    <span class="keyword">template</span> <span class="special">&lt;</span><span class="keyword">typename</span> <span class="identifier">A0</span><span class="special">&gt;</span>
    <span class="identifier">A0</span> <span class="keyword">operator</span><span class="special">()(</span><span class="identifier">A0</span> <span class="keyword">const</span> <span class="special">&amp;</span> <span class="identifier">a0</span><span class="special">)</span> <span class="keyword">const</span>
    <span class="special">{</span>
        <span class="keyword">return</span> <span class="identifier">a0</span><span class="special">;</span>
    <span class="special">}</span>

  <span class="special">};</span>

<span class="special">}</span>

<span class="keyword">typedef</span> <span class="identifier">boost</span><span class="special">::</span><span class="identifier">phoenix</span><span class="special">::</span><span class="identifier">function</span><span class="special">&lt;</span><span class="identifier">impl</span><span class="special">::</span><span class="identifier">Id</span><span class="special">&gt;</span> <span class="identifier">Id</span><span class="special">;</span>
<span class="identifier">Id</span> <span class="identifier">id</span><span class="special">;</span>
</pre>
<h3>
<a name="phoenix.lazy_list.implementation_details.h4"></a>
        <span><a name="phoenix.lazy_list.implementation_details.functions_with_defined_return_type"></a></span><a class="link" href="implementation_details.html#phoenix.lazy_list.implementation_details.functions_with_defined_return_type">Functions
        with defined return type</a>
      </h3>
<p>
        Sometimes it is necessary to define a function using a templated struct,
        where the template parameter type defines the return type.
      </p>
<h4>
<a name="phoenix.lazy_list.implementation_details.h5"></a>
        <span><a name="phoenix.lazy_list.implementation_details.example_with_one_argument"></a></span><a class="link" href="implementation_details.html#phoenix.lazy_list.implementation_details.example_with_one_argument">Example
        with one argument</a>
      </h4>
<pre class="programlisting"><span class="keyword">namespace</span> <span class="identifier">impl</span> <span class="special">{</span>

  <span class="keyword">template</span> <span class="special">&lt;</span><span class="keyword">typename</span> <span class="identifier">Result</span><span class="special">&gt;</span>
  <span class="keyword">struct</span> <span class="identifier">what</span> <span class="special">{</span>

    <span class="keyword">typedef</span> <span class="identifier">Result</span> <span class="identifier">result_type</span><span class="special">;</span>

    <span class="identifier">Result</span> <span class="keyword">operator</span><span class="special">()(</span><span class="identifier">Result</span> <span class="keyword">const</span> <span class="special">&amp;</span> <span class="identifier">r</span><span class="special">)</span> <span class="keyword">const</span>
    <span class="special">{</span>
      <span class="keyword">return</span> <span class="identifier">r</span><span class="special">;</span>
    <span class="special">}</span>
  <span class="special">};</span>

<span class="special">}</span>

<span class="identifier">boost</span><span class="special">::</span><span class="identifier">function1</span><span class="special">&lt;</span><span class="keyword">int</span><span class="special">,</span> <span class="keyword">int</span> <span class="special">&gt;</span> <span class="identifier">what_int</span> <span class="special">=</span> <span class="identifier">impl</span><span class="special">::</span><span class="identifier">what</span><span class="special">&lt;</span><span class="keyword">int</span><span class="special">&gt;();</span>
<span class="keyword">typedef</span> <span class="identifier">boost</span><span class="special">::</span><span class="identifier">function1</span><span class="special">&lt;</span><span class="keyword">int</span><span class="special">,</span><span class="keyword">int</span><span class="special">&gt;</span> <span class="identifier">fun1_int_int</span><span class="special">;</span>
<span class="keyword">typedef</span> <span class="identifier">boost</span><span class="special">::</span><span class="identifier">phoenix</span><span class="special">::</span><span class="identifier">function</span><span class="special">&lt;</span><span class="identifier">fun1_int_int</span><span class="special">&gt;</span> <span class="identifier">What_arg</span><span class="special">;</span>
<span class="identifier">What_arg</span> <span class="identifier">what_arg</span><span class="special">(</span><span class="identifier">what_int</span><span class="special">);</span>
</pre>
<h4>
<a name="phoenix.lazy_list.implementation_details.h6"></a>
        <span><a name="phoenix.lazy_list.implementation_details.example_with_zero_arguments"></a></span><a class="link" href="implementation_details.html#phoenix.lazy_list.implementation_details.example_with_zero_arguments">Example
        with zero arguments</a>
      </h4>
<pre class="programlisting"><span class="keyword">namespace</span> <span class="identifier">impl</span> <span class="special">{</span>
  <span class="keyword">template</span> <span class="special">&lt;</span><span class="keyword">typename</span> <span class="identifier">Result</span><span class="special">&gt;</span>
  <span class="keyword">struct</span> <span class="identifier">what0</span> <span class="special">{</span>

    <span class="keyword">typedef</span> <span class="identifier">Result</span> <span class="identifier">result_type</span><span class="special">;</span>

    <span class="identifier">Result</span> <span class="keyword">operator</span><span class="special">()()</span> <span class="keyword">const</span>
    <span class="special">{</span>
      <span class="keyword">return</span> <span class="identifier">Result</span><span class="special">(</span><span class="number">100</span><span class="special">);</span>
    <span class="special">}</span>

  <span class="special">};</span>
<span class="special">}</span>

<span class="keyword">typedef</span> <span class="identifier">boost</span><span class="special">::</span><span class="identifier">function0</span><span class="special">&lt;</span><span class="keyword">int</span><span class="special">&gt;</span> <span class="identifier">fun0_int</span><span class="special">;</span>
<span class="identifier">boost</span><span class="special">::</span><span class="identifier">function0</span><span class="special">&lt;</span><span class="keyword">int</span><span class="special">&gt;</span> <span class="identifier">what0_int</span> <span class="special">=</span> <span class="identifier">impl</span><span class="special">::</span><span class="identifier">what0</span><span class="special">&lt;</span><span class="keyword">int</span><span class="special">&gt;();</span>
<span class="keyword">typedef</span> <span class="identifier">boost</span><span class="special">::</span><span class="identifier">phoenix</span><span class="special">::</span><span class="identifier">function</span><span class="special">&lt;</span><span class="identifier">fun0_int</span><span class="special">&gt;</span> <span class="identifier">What0_arg</span><span class="special">;</span>
<span class="identifier">What0_arg</span> <span class="identifier">what0_arg</span><span class="special">(</span><span class="identifier">what0_int</span><span class="special">);</span>
</pre>
<h3>
<a name="phoenix.lazy_list.implementation_details.h7"></a>
        <span><a name="phoenix.lazy_list.implementation_details.list_generation_implementation"></a></span><a class="link" href="implementation_details.html#phoenix.lazy_list.implementation_details.list_generation_implementation">List
        Generation Implementation</a>
      </h3>
<p>
        The implementation of the function
      </p>
<pre class="programlisting"><span class="identifier">enum_from</span><span class="special">(</span><span class="number">1</span><span class="special">)</span>
</pre>
<p>
        requires a functor which will evaluate the successive numbers on demand.
        The code from <a href="http://cgi.di.uoa.gr/~smaragd/fc++/" target="_top">FC++</a>
        has been reimplemented using internal functors as follows.
      </p>
<p>
        This code has to carefully manipulate the input type T to construct the result
        type which is a list.
      </p>
<p>
        The code in EFH is used to build a series of objects which each add one element
        to the list and return the function which will add the next element. That
        only gets called when it is needed.
      </p>
<pre class="programlisting">      <span class="keyword">template</span> <span class="special">&lt;</span><span class="keyword">class</span> <span class="identifier">T</span><span class="special">&gt;</span>
      <span class="keyword">struct</span> <span class="identifier">EFH</span>
      <span class="special">{</span>
          <span class="keyword">mutable</span> <span class="identifier">T</span> <span class="identifier">x</span><span class="special">;</span>
          <span class="identifier">EFH</span><span class="special">(</span> <span class="keyword">const</span> <span class="identifier">T</span><span class="special">&amp;</span> <span class="identifier">xx</span><span class="special">)</span> <span class="special">:</span> <span class="identifier">x</span><span class="special">(</span><span class="identifier">xx</span><span class="special">)</span> <span class="special">{}</span>
          <span class="keyword">template</span> <span class="special">&lt;</span><span class="keyword">typename</span> <span class="identifier">Sig</span><span class="special">&gt;</span> <span class="keyword">struct</span> <span class="identifier">result</span><span class="special">;</span>

          <span class="keyword">template</span> <span class="special">&lt;</span><span class="keyword">typename</span> <span class="identifier">This</span><span class="special">,</span> <span class="keyword">class</span> <span class="identifier">TT</span><span class="special">&gt;</span>
          <span class="keyword">struct</span> <span class="identifier">result</span><span class="special">&lt;</span><span class="identifier">This</span><span class="special">(</span><span class="identifier">TT</span><span class="special">)&gt;</span>
          <span class="special">{</span>
            <span class="keyword">typedef</span> <span class="keyword">typename</span> <span class="identifier">boost</span><span class="special">::</span><span class="identifier">phoenix</span><span class="special">::</span><span class="identifier">UseList</span><span class="special">::</span><span class="keyword">template</span>
                    <span class="identifier">List</span><span class="special">&lt;</span><span class="identifier">TT</span><span class="special">&gt;::</span><span class="identifier">type</span> <span class="identifier">LType</span><span class="special">;</span>
            <span class="keyword">typedef</span> <span class="keyword">typename</span> <span class="identifier">boost</span><span class="special">::</span><span class="identifier">phoenix</span><span class="special">::</span><span class="identifier">result_of</span><span class="special">::</span>
                    <span class="identifier">ListType</span><span class="special">&lt;</span><span class="identifier">LType</span><span class="special">&gt;::</span><span class="identifier">delay_result_type</span> <span class="identifier">type</span><span class="special">;</span>
          <span class="special">};</span>
          <span class="keyword">typename</span> <span class="identifier">result</span><span class="special">&lt;</span><span class="identifier">EFH</span><span class="special">(</span><span class="identifier">T</span><span class="special">)&gt;::</span><span class="identifier">type</span> <span class="keyword">operator</span><span class="special">()()</span> <span class="keyword">const</span> <span class="special">{</span>
            <span class="keyword">typedef</span> <span class="keyword">typename</span> <span class="identifier">UseList</span><span class="special">::</span><span class="keyword">template</span> <span class="identifier">List</span><span class="special">&lt;</span><span class="identifier">T</span><span class="special">&gt;::</span><span class="identifier">type</span> <span class="identifier">LType</span><span class="special">;</span>
            <span class="keyword">typedef</span> <span class="keyword">typename</span> <span class="identifier">result_of</span><span class="special">::</span><span class="identifier">ListType</span><span class="special">&lt;</span><span class="identifier">LType</span><span class="special">&gt;::</span>
                    <span class="identifier">delay_result_type</span> <span class="identifier">result_type</span><span class="special">;</span>
            <span class="keyword">typedef</span> <span class="identifier">boost</span><span class="special">::</span><span class="identifier">function0</span><span class="special">&lt;</span><span class="identifier">result_type</span><span class="special">&gt;</span> <span class="identifier">fun1_R_TTT</span><span class="special">;</span>
            <span class="special">++</span><span class="identifier">x</span><span class="special">;</span>
            <span class="identifier">fun1_R_TTT</span> <span class="identifier">efh_R_TTT</span> <span class="special">=</span> <span class="identifier">EFH</span><span class="special">&lt;</span><span class="identifier">T</span><span class="special">&gt;(</span><span class="identifier">x</span><span class="special">);</span>
            <span class="keyword">typedef</span> <span class="identifier">boost</span><span class="special">::</span><span class="identifier">phoenix</span><span class="special">::</span><span class="identifier">function</span><span class="special">&lt;</span><span class="identifier">fun1_R_TTT</span><span class="special">&gt;</span> <span class="identifier">EFH_R_T</span><span class="special">;</span>
            <span class="identifier">EFH_R_T</span> <span class="identifier">efh_R_T</span><span class="special">(</span><span class="identifier">efh_R_TTT</span><span class="special">);</span>
<span class="preprocessor">#ifndef</span> <span class="identifier">BOOST_PHOENIX_NO_LAZY_EXCEPTIONS</span>
            <span class="keyword">if</span> <span class="special">(</span><span class="identifier">x</span> <span class="special">&gt;</span> <span class="identifier">BOOST_PHOENIX_FUNCTION_MAX_LAZY_LIST_LENGTH</span><span class="special">)</span>
                 <span class="keyword">throw</span> <span class="identifier">lazy_exception</span><span class="special">(</span><span class="string">"Running away in EFH!!"</span><span class="special">);</span>
<span class="preprocessor">#endif</span>
            <span class="keyword">return</span> <span class="identifier">cons</span><span class="special">(</span> <span class="identifier">x</span><span class="special">-</span><span class="number">1</span><span class="special">,</span> <span class="identifier">efh_R_T</span><span class="special">()</span> <span class="special">);</span>
          <span class="special">}</span>
      <span class="special">};</span>

      <span class="keyword">struct</span> <span class="identifier">Enum_from</span> <span class="special">{</span>
         <span class="keyword">template</span> <span class="special">&lt;</span><span class="keyword">typename</span> <span class="identifier">Sig</span><span class="special">&gt;</span> <span class="keyword">struct</span> <span class="identifier">result</span><span class="special">;</span>

         <span class="keyword">template</span> <span class="special">&lt;</span><span class="keyword">typename</span> <span class="identifier">This</span><span class="special">,</span> <span class="keyword">typename</span> <span class="identifier">T</span><span class="special">&gt;</span>
         <span class="keyword">struct</span> <span class="identifier">result</span><span class="special">&lt;</span><span class="identifier">This</span><span class="special">(</span><span class="identifier">T</span><span class="special">)&gt;</span>
         <span class="special">{</span>
           <span class="keyword">typedef</span> <span class="keyword">typename</span> <span class="identifier">boost</span><span class="special">::</span><span class="identifier">remove_reference</span><span class="special">&lt;</span><span class="identifier">T</span><span class="special">&gt;::</span><span class="identifier">type</span> <span class="identifier">TT</span><span class="special">;</span>
           <span class="keyword">typedef</span> <span class="keyword">typename</span> <span class="identifier">boost</span><span class="special">::</span><span class="identifier">remove_const</span><span class="special">&lt;</span><span class="identifier">TT</span><span class="special">&gt;::</span><span class="identifier">type</span> <span class="identifier">TTT</span><span class="special">;</span>
           <span class="keyword">typedef</span> <span class="keyword">typename</span> <span class="identifier">UseList</span><span class="special">::</span><span class="keyword">template</span> <span class="identifier">List</span><span class="special">&lt;</span><span class="identifier">TTT</span><span class="special">&gt;::</span><span class="identifier">type</span> <span class="identifier">LType</span><span class="special">;</span>
           <span class="keyword">typedef</span> <span class="keyword">typename</span> <span class="identifier">result_of</span><span class="special">::</span><span class="identifier">ListType</span><span class="special">&lt;</span><span class="identifier">LType</span><span class="special">&gt;::</span>
                   <span class="identifier">delay_result_type</span> <span class="identifier">type</span><span class="special">;</span>
         <span class="special">};</span>

         <span class="keyword">template</span> <span class="special">&lt;</span><span class="keyword">class</span> <span class="identifier">T</span><span class="special">&gt;</span>
         <span class="keyword">typename</span> <span class="identifier">result</span><span class="special">&lt;</span><span class="identifier">Enum_from</span><span class="special">(</span><span class="identifier">T</span><span class="special">)&gt;::</span><span class="identifier">type</span> <span class="keyword">operator</span><span class="special">()</span>
            <span class="special">(</span><span class="keyword">const</span> <span class="identifier">T</span> <span class="special">&amp;</span> <span class="identifier">x</span><span class="special">)</span> <span class="keyword">const</span>
          <span class="special">{</span>
            <span class="keyword">typedef</span> <span class="keyword">typename</span> <span class="identifier">boost</span><span class="special">::</span><span class="identifier">remove_reference</span><span class="special">&lt;</span><span class="identifier">T</span><span class="special">&gt;::</span><span class="identifier">type</span> <span class="identifier">TT</span><span class="special">;</span>
            <span class="keyword">typedef</span> <span class="keyword">typename</span> <span class="identifier">boost</span><span class="special">::</span><span class="identifier">remove_const</span><span class="special">&lt;</span><span class="identifier">TT</span><span class="special">&gt;::</span><span class="identifier">type</span> <span class="identifier">TTT</span><span class="special">;</span>
            <span class="keyword">typedef</span> <span class="keyword">typename</span> <span class="identifier">UseList</span><span class="special">::</span><span class="keyword">template</span> <span class="identifier">List</span><span class="special">&lt;</span><span class="identifier">T</span><span class="special">&gt;::</span><span class="identifier">type</span> <span class="identifier">LType</span><span class="special">;</span>
            <span class="keyword">typedef</span> <span class="keyword">typename</span> <span class="identifier">result_of</span><span class="special">::</span><span class="identifier">ListType</span><span class="special">&lt;</span><span class="identifier">LType</span><span class="special">&gt;::</span>
                    <span class="identifier">delay_result_type</span> <span class="identifier">result_type</span><span class="special">;</span>
            <span class="keyword">typedef</span> <span class="identifier">boost</span><span class="special">::</span><span class="identifier">function0</span><span class="special">&lt;</span><span class="identifier">result_type</span><span class="special">&gt;</span> <span class="identifier">fun1_R_TTT</span><span class="special">;</span>
            <span class="identifier">fun1_R_TTT</span> <span class="identifier">efh_R_TTT</span> <span class="special">=</span> <span class="identifier">EFH</span><span class="special">&lt;</span><span class="identifier">TTT</span><span class="special">&gt;(</span><span class="identifier">x</span><span class="special">);</span>
            <span class="keyword">typedef</span> <span class="identifier">boost</span><span class="special">::</span><span class="identifier">phoenix</span><span class="special">::</span><span class="identifier">function</span><span class="special">&lt;</span><span class="identifier">fun1_R_TTT</span><span class="special">&gt;</span> <span class="identifier">EFH_R_T</span><span class="special">;</span>
            <span class="identifier">EFH_R_T</span> <span class="identifier">efh_R_T</span><span class="special">(</span><span class="identifier">efh_R_TTT</span><span class="special">);</span>
            <span class="comment">//std::cout &lt;&lt; "enum_from (" &lt;&lt; x &lt;&lt; ")" &lt;&lt; std::endl;</span>
            <span class="keyword">return</span> <span class="identifier">efh_R_T</span><span class="special">();</span>
          <span class="special">}</span>
      <span class="special">};</span>
</pre>
<p>
        Similar code is used in the related functors
      </p>
<pre class="programlisting"><span class="identifier">enum_from_to</span>
<span class="identifier">filter</span>
</pre>
<h3>
<a name="phoenix.lazy_list.implementation_details.h8"></a>
        <span><a name="phoenix.lazy_list.implementation_details.conclusion"></a></span><a class="link" href="implementation_details.html#phoenix.lazy_list.implementation_details.conclusion">Conclusion</a>
      </h3>
<p>
        These implementation mechanisms have been carried through consistently in
        the implementation.
      </p>
</div>
<table xmlns:rev="http://www.cs.rpi.edu/~gregod/boost/tools/doc/revision" width="100%"><tr>
<td align="left"></td>
<td align="right"><div class="copyright-footer">Copyright &#169; 2002-2005, 2010, 2014, 2015 Joel de Guzman, Dan Marsden, Thomas
      Heller, John Fletcher<p>
        Distributed under the Boost Software License, Version 1.0. (See accompanying
        file LICENSE_1_0.txt or copy at <a href="http://www.boost.org/LICENSE_1_0.txt" target="_top">http://www.boost.org/LICENSE_1_0.txt</a>)
      </p>
</div></td>
</tr></table>
<hr>
<div class="spirit-nav">
<a accesskey="p" href="exceptions.html"><img src="../../../../../../doc/src/images/prev.png" alt="Prev"></a><a accesskey="u" href="../lazy_list.html"><img src="../../../../../../doc/src/images/up.png" alt="Up"></a><a accesskey="h" href="../../index.html"><img src="../../../../../../doc/src/images/home.png" alt="Home"></a><a accesskey="n" href="testing.html"><img src="../../../../../../doc/src/images/next.png" alt="Next"></a>
</div>
</body>
</html>
